package com.cmic.rcs.emoji.common;

import com.cmic.rcs.emoji.entity.dto.UserDto;

/**
 * UserContext
 *
 * @author hzr
 */
public class UserContext {

    private static final ThreadLocal<UserDto> USER_THREAD_LOCAL = new ThreadLocal<>();

    public static void setUserDto(UserDto userDto) {
        USER_THREAD_LOCAL.set(userDto);
    }

    public static UserDto getUserDto() {
        return USER_THREAD_LOCAL.get();
    }

    public static void remove() {
        USER_THREAD_LOCAL.remove();
    }
}